package com.addplus.townmall.server.api.modelenum;
/**
 * 类名: OrderStateEnum
 *
 * @author zhangjiehang
 * @version V1.0
 * @date 2018/9/25 上午11:21
 * @description 类描述:订单状态枚举类
 */
public enum OrderStateEnum {
    /**
     * 订单状态
     */
    NOT_PAID(1, "未付款"),
    PAID(2, "已付款"),
    NOT_DELIVER(3, "未发货"),
    DELIVER(4, "已发货"),
    DEAL_SUCCESSFUL(5, "交易成功"),
    DEAL_CLOSE(6, "交易关闭");

    private int status;
    private String stateInfo;

    OrderStateEnum(int status, String stateInfo) {
        this.status = status;
        this.stateInfo = stateInfo;
    }

    public int getStatus() {
        return status;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public static OrderStateEnum stateOf(int state) {
        for (OrderStateEnum orderState : values()) {
            if (orderState.getStatus() == state) {
                return orderState;
            }
        }
        return null;
    }}
